home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 1
/
CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso
/
Aminet
/
comm
/
tcp
/
archie38_1.lha
/
archie-1.4
/
amiga
/
getuid.c
< prev
Wrap
C/C++ Source or Header
|
1995-01-05
|
635b
|
33 lines
/* Amiga port by Tomas Willis (tomas@cae.wisc.edu) January 1995 */
/* This is my little routine to trick up the AmiTCP uid.
* Why this isn't a standar funciton, I don't know. I probably
* missed something in the docs. --tcw
*/
/* Amiga port by Tomas Willis (tomas@cae.wisc.edu) January 1995 */
#include <pwd.h>
#include <stdlib.h>
#include <string.h>
//protos
unsigned long getuid(void);
unsigned long
getuid(void)
{
struct passwd *pw=NULL;
char *un=NULL;
ULONG uid = 1;
un = getenv("USERNAME");
if (0 != strlen(un)) {
pw = getpwnam(un);
if (NULL != pw) {
uid = pw->pw_uid;
}
}
return(uid);
}